package br.com.duosoftware.orcamento.daos;

import br.com.duosoftware.orcamento.entidades.PlanoDeContaExtra;
import java.util.List;

/**
 *
 * @author Renato
 *
 */
public class PlanoDeContaExtraDAO extends DAOGenerico {

    public void salvarOuAtualizar(PlanoDeContaExtra planoDeContaExtra) {
        salvarOuAtualizarPojo(planoDeContaExtra);
    }

    public void excluir(PlanoDeContaExtra planoDeContaExtra) {
        excluirPojo(planoDeContaExtra);
    }

    public PlanoDeContaExtra getPlanoDeContaExtraPorId(long id) {
        return getPojo(PlanoDeContaExtra.class, id);
    }

    public List<PlanoDeContaExtra> listarPlanosDeContaExtra() {
        return getPojos("FROM PlanoDeContaExtra planoDeContaExtra "
                      + "ORDER BY planoDeContaExtra.id");
    }

    public List<PlanoDeContaExtra> listarPlanosDeContaCamara() {
        return getPojos("FROM PlanoDeContaExtra planoDeContaExtra "
                      + "WHERE planoDeContaExtra.conta LIKE ?",
                        "2%");
    }

}
